#include <stdio.h>
#include <cstring> 
int a[9][9];
int has5H(int x, int y){
	int count=0;
	int t=y-1;
	while((t>=0) && (a[x][t]==1)){
		count++;
		t--;
	}
	t=y+1;
	while((t<=9) && (a[x][t]==1)){
		count++;
		t++;
	}
	if(count>=4){
		return 1;
	}
	return 0;
}
int main(){	
	memset(a,0,sizeof(a));
	int x;
	int y; 
	while(1){
		scanf("%d %d", &x, &y);	
		if(x==0 && y==0){
			break;
		}  
		a[x-1][y-1]=1;  
		if(has5H(x-1,y-1))
			printf("Yes"); 
		else
			printf("No\n"); 							
	}
}
